#include "soundthread.h"
#include <QSound>
#include <QDebug>
QSoundThread::QSoundThread(QObject *parent) : QThread(parent)
{

}
QSoundThread::QSoundThread(const QString url,QObject* parent)
{
    this->setParent(parent);
    isplay = false;
    this->url = url;
}
void QSoundThread::run()
{
    while (isRunning()) {
        if(isplay)
        {
            //自己的逻辑操作
            isplay = false;
        }else
        {
            this->sleep(1);
        }
        qDebug()<<"thread "<<isplay<<"url = "<<url;
    }

    exec();
}
